package cn.senwill.utils;

import java.util.Random;

public class RandomStringUtil {
    public static String generator (int len) {
        String characters = "abcdefghijklmnopqrstuvwxyz0123456789";
        StringBuilder stringBuilder = new StringBuilder(len);
        Random random = new Random();
        for (int i = 0; i < len; i++) {
            int characterIndex = random.nextInt(characters.length());
            stringBuilder.append(characters.charAt(characterIndex));
        }
        String result = stringBuilder.toString();
        return result;
    }
}